package com.etc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Student {
    @Value("10")
    private String age;
    @Value("tom")
    private String name;

    @Autowired
    @Qualifier("cat")
//    @Resource(name="cat")
    private Pet pet;

    public void weishi() {
        pet.weishi();
    }

    public Pet getPet() {
        return pet;
    }

    public void setPet(Pet pet) {
        this.pet = pet;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Student(String age, String name) {
        this.age = age;
        this.name = name;
    }

    public Student() {
    }
}
